package com.example.android.kotlin

fun main() {
    val person = Person("呼噜", 4)
    person.info()
    val cat = Cat("小橘", 2, 100)
    cat.intro()
}

class Person constructor(var name: String, var age: Number) {
    fun info() {
        println("我是$name,今年${age}岁")
    }
}

class Cat(val name: String) {
    var age: Int = 0
    var score: Int = 0

    constructor(name: String, age: Int) : this(name) {
        this.age = age
    }

    constructor(name: String, age: Int, score: Int) : this(name, age) {
        this.score = score
    }

    fun intro() {
        println("我的名字叫$name,今年${age}岁了,我的分数是${score}")
        println("我叫$name")
    }

}